package com.mopa.http;
import android.os.Bundle;
public class QzoneAPI {
	public QzoneAPI()
	{
	}
	public static void openid(String access_token, Callback callback)
	{
		String url = String.format("https://graph.qq.com/oauth2.0/me?access_token=%s", new Object[] {
			access_token
		});
		asyncRequest(url, new OpenIDListener(callback));
	}
	public static void uploadPic(String access_token, String appid, String openid, Bundle parameters, Callback callback)
	{
		parameters.putString("format", "json");
		parameters.putString("access_token", access_token);
		parameters.putString("oauth_consumer_key", appid);
		parameters.putString("openid", openid);
		asyncPost("https://graph.qq.com/photo/upload_pic", parameters, new UploadPicListener(callback));
	}
	
	private static void asyncRequest(String url, IRequestListener listener)
	{
		(new AsyncHttpRequestRunner()).request(url, null, listener);
	}
	
	private static void asyncPost(String url, Bundle parameters, IRequestListener listener)
	{
		(new AsyncHttpPostRunner()).request(url, parameters, listener);
	}

}
